using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._CartographyTools._Generalization
{
    /// <summary>
    /// <para>Create Cartographic Partitions</para>
    /// <para>Creates a mesh of polygon features that cover the input feature class in which each output polygon encloses no more than a specified number of  input features or input vertices. as determined by the density and distribution of the input features.</para>
    /// <para>创建覆盖输入要素类的面要素网格，其中每个输出面包含的输入要素或输入折点不超过指定数量的输入要素或输入折点。由输入要素的密度和分布决定。</para>
    /// </summary>    
    [DisplayName("Create Cartographic Partitions")]
    public class CreateCartographicPartitions : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public CreateCartographicPartitions()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_features">
        /// <para>Input Features</para>
        /// <para>The input feature classes or layers with feature distribution and density, or vertex distribution and density, that determine the size and arrangement of output polygons. The input features are typically destined for subsequent processing with other geoprocessing tools. Typically, the input features, when considered simultaneously, would exceed memory limitations of other tools, so partitions are created to subdivide inputs for processing.</para>
        /// <para>具有要素分布和密度（或折点分布和密度）的输入要素类或图层，用于确定输出面的大小和排列。输入要素通常用于使用其他地理处理工具进行后续处理。通常，当同时考虑输入功能时，会超过其他工具的内存限制，因此会创建分区来细分输入以进行处理。</para>
        /// </param>
        /// <param name="_out_features">
        /// <para>Output Features</para>
        /// <para>The output polygon feature class of partitions each of which encloses a manageable number of input features or manageable number of input vertices not exceeding the number specified by the Feature Count parameter.</para>
        /// <para>分区的输出面要素类，每个分区包含可管理数量的输入要素或可管理数量的输入折点，且不超过要素计数参数指定的数量。</para>
        /// </param>
        /// <param name="_feature_count">
        /// <para>Feature Count</para>
        /// <para>The ideal number of features or vertices (depending on the Partition Method parameter value) to be enclosed by each polygon in the output feature class. The recommended count for features is 50,000, which is the default value. For vertices, 1 million vertices will consume approximately 0.5 GB of memory depending on the tool using the partitions. The feature count cannot be less than 500.</para>
        /// <para>输出要素类中每个面要包围的理想要素或折点数（取决于分区方法参数值）。建议的功能计数为 50,000，这是默认值。对于顶点，100 万个顶点将消耗大约 0.5 GB 的内存，具体取决于使用分区的工具。要素计数不能小于 500。</para>
        /// </param>
        public CreateCartographicPartitions(List<object> _in_features, object _out_features, long _feature_count)
        {
            this._in_features = _in_features;
            this._out_features = _out_features;
            this._feature_count = _feature_count;
        }
        public override string ToolboxName => "Cartography Tools";

        public override string ToolName => "Create Cartographic Partitions";

        public override string CallName => "cartography.CreateCartographicPartitions";

        public override List<string> AcceptEnvironments => ["outputCoordinateSystem"];

        public override object[] ParameterInfo => [_in_features, _out_features, _feature_count, _partition_method.GetGPValue()];

        /// <summary>
        /// <para>Input Features</para>
        /// <para>The input feature classes or layers with feature distribution and density, or vertex distribution and density, that determine the size and arrangement of output polygons. The input features are typically destined for subsequent processing with other geoprocessing tools. Typically, the input features, when considered simultaneously, would exceed memory limitations of other tools, so partitions are created to subdivide inputs for processing.</para>
        /// <para>具有要素分布和密度（或折点分布和密度）的输入要素类或图层，用于确定输出面的大小和排列。输入要素通常用于使用其他地理处理工具进行后续处理。通常，当同时考虑输入功能时，会超过其他工具的内存限制，因此会创建分区来细分输入以进行处理。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public List<object> _in_features { get; set; }


        /// <summary>
        /// <para>Output Features</para>
        /// <para>The output polygon feature class of partitions each of which encloses a manageable number of input features or manageable number of input vertices not exceeding the number specified by the Feature Count parameter.</para>
        /// <para>分区的输出面要素类，每个分区包含可管理数量的输入要素或可管理数量的输入折点，且不超过要素计数参数指定的数量。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_features { get; set; }


        /// <summary>
        /// <para>Feature Count</para>
        /// <para>The ideal number of features or vertices (depending on the Partition Method parameter value) to be enclosed by each polygon in the output feature class. The recommended count for features is 50,000, which is the default value. For vertices, 1 million vertices will consume approximately 0.5 GB of memory depending on the tool using the partitions. The feature count cannot be less than 500.</para>
        /// <para>输出要素类中每个面要包围的理想要素或折点数（取决于分区方法参数值）。建议的功能计数为 50,000，这是默认值。对于顶点，100 万个顶点将消耗大约 0.5 GB 的内存，具体取决于使用分区的工具。要素计数不能小于 500。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Feature Count")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public long _feature_count { get; set; }


        /// <summary>
        /// <para>Partition Method</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the Feature Count parameter references the ideal number of features or the ideal number of vertices in each output polygon.</para>
        ///   <bulletList>
        ///     <bullet_item>Features—Partitioning considers the number and density of individual features. This method is applicable in most cases and is the default.</bullet_item><para/>
        ///     <bullet_item>Vertices—Partitioning considers the number and density of vertices. This method is used in cases in which the input data contains a relatively small number of very complex features, such as high-resolution country polygons, or when very long features are likely to cross multiple partition boundaries, such as contour lines.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定要素计数参数是引用每个输出面中的理想要素数还是理想折点数。</para>
        ///   <bulletList>
        ///     <bullet_item>要素 - 分区考虑各个要素的数量和密度。此方法适用于大多数情况，并且是默认方法。</bullet_item><para/>
        ///     <bullet_item>顶点 - 分区考虑折点的数量和密度。如果输入数据包含相对较少的非常复杂的要素（例如高分辨率国家/地区面），或者非常长的要素可能跨越多个分区边界（例如等值线），则使用此方法。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Partition Method")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _partition_method_value _partition_method { get; set; } = _partition_method_value._FEATURES;

        public enum _partition_method_value
        {
            /// <summary>
            /// <para>Features</para>
            /// <para>Features—Partitioning considers the number and density of individual features. This method is applicable in most cases and is the default.</para>
            /// <para>要素 - 分区考虑各个要素的数量和密度。此方法适用于大多数情况，并且是默认方法。</para>
            /// </summary>
            [Description("Features")]
            [GPEnumValue("FEATURES")]
            _FEATURES,

            /// <summary>
            /// <para>Vertices</para>
            /// <para>Vertices—Partitioning considers the number and density of vertices. This method is used in cases in which the input data contains a relatively small number of very complex features, such as high-resolution country polygons, or when very long features are likely to cross multiple partition boundaries, such as contour lines.</para>
            /// <para>顶点 - 分区考虑折点的数量和密度。如果输入数据包含相对较少的非常复杂的要素（例如高分辨率国家/地区面），或者非常长的要素可能跨越多个分区边界（例如等值线），则使用此方法。</para>
            /// </summary>
            [Description("Vertices")]
            [GPEnumValue("VERTICES")]
            _VERTICES,

        }

        public CreateCartographicPartitions SetEnv(object outputCoordinateSystem = null)
        {
            base.SetEnv(outputCoordinateSystem: outputCoordinateSystem);
            return this;
        }

    }

}